@extends('layouts.back_stage')
@section('content')
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/commonjs/jquery.select.js"></script>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/commonjs/jquery.page.js?v=1.0.3"></script>
    <style>
        .form_ul{width:100%;height:30px;margin-bottom:20px;}
        .form_li{width:210px;line-height:30px;margin-right:10px;float:left;font-size:14px;}
        .form_inp{width:130px;height:30px;line-height:30px;font-size:14px;float:right;outline:none;border:1px solid #cfdada;background:#fff;border-radius:2px;padding:6px 12px;color:#555;box-shadow: none;}
        .sel_inp{width:130px;height:30px;line-height:30px;font-size:14px;float:right;outline:none;border:1px solid #cfdada;background:#fff;border-radius:2px;padding:4px 8px;color:#555;box-shadow: none;}
        .fabric_div1{width:100%;}
        .tab1{border-collapse:collapse;width:100%;font-size:14px;color:#383838;background:#fff;margin-bottom:10px;}
        table td{text-align:center;height:35px;}
        table,th,td{border:1px solid #ccc;}
        .oneTb{width:100%;overflow-x:scroll;overflow-y:hidden;}
        ::-webkit-scrollbar{width:5px;height:5px;}
        .tab1 .form_inp,.tab1 .sel_inp{width:100%;height:100%;outline:none;background:#fff;border:none;padding:0;cursor:pointer;text-align:center;}
        /*遮罩层*/
        .mask{position:fixed;top:0;right:0;left:0;bottom:0;z-index:10000;background:#000;opacity:0.8;filter:alpha(opacity=80);-moz-user-select: none; -webkit-user-select: none;}
        /*弹框*/
        .info_box{position:absolute;top:25%;left:30%;width:800px;height:auto;overflow:hidden;background:#fff;z-index:99999;padding:15px;display:none;}
        .chaL{position:absolute;top:-3px;right:0;color:red;font-size:20px;cursor:pointer;}
        .gong{width:100%;}
        .gong tbody tr:hover{background:#27c24c;cursor:pointer;color:#fff;}
        .shuoMing{appearance:none;-moz-appearance:none;-webkit-appearance:none;text-indent:10px;}
        .tab1 .guiGe,.tab1 .shuoMing,.tab1 .unit,.tab1 .fabric_ingredient{background:#F5F5F5;cursor:default;}
        .save_add{margin-top:30px;margin-left:50%;}
    </style>
    <script>
        //供应商
        var suppliers = [
            <?php $j = count($suppliers_arr);$i = 0; ?>
                    @foreach ($suppliers_arr as $k=>$v )'{{$v["name"]}}'<?php $i++;?> @if($i<$j),@endif
            @endforeach
        ];
    </script>
    <div class="container">
        <div class="row">
            <div style="margin:30px;"><h3 >添加采购计划单</h3></div>
            <div style="width:95%;margin-left:40px;">
                <div class="form-group"><h3 >基本信息</h3></div>
                <div class="form-group">
                    <ul class="form_ul">
                        <li class="form_li">供应商：<input id="colorInput0" class="form_inp supplier_name" value="{{ $plan_info->supplier_name}}" type="text" autocomplete="off" autocorrect="off" placeholder="供应商"  /></li>
                        <li class="form_li">销售季节：
                            <select class="sel_inp sale_quarter">
                                <option value="">请选择</option>
                                @if(count($season))
                                    @foreach($season as $k => $v)
                                        <option value="{{$v}}" @if(isset($plan_info->sale_quarter) && $plan_info->sale_quarter==$v) selected @endif>{{$v}}</option>
                                    @endforeach
                                @endif
                            </select>
                        </li>
                        <li class="form_li">到货状态：
                            <select class="sel_inp goods_status">
                                @if($plan_info->goods_status==0)
                                <option value="0">未到货</option>
                                @else
                                <option value="1">已到货</option>
                                @endif
                                <option value="0">未到货</option>
                                <option value="1">已到货</option>
                            </select>
                        </li>
                        <li class="form_li">采购类型：
                            <select class="sel_inp purchase_type">
                                @if($plan_info->purchase_type==0)
                                    <option value="1">计划采购</option>
                                @else
                                    <option value="2">提前采购</option>
                                @endif
                                <option value="1">计划采购</option>
                                <option value="2">提前采购</option>
                            </select>
                        </li>
                    </ul>
                    <ul class="form_ul">
                        <li class="form_li" style="width:870px;">服务款号：<input style="width:790px;" class="form_inp server_girards" value="{{$plan_info->server_girards}}" type="text" autocomplete="off" autocorrect="off" placeholder="服务款号"  /></li>
                    </ul>
                    <ul class="form_ul">
                        <li class="form_li" style="width:870px;">备注：<input style="width:790px;"class="form_inp remark" value="{{$plan_info->remark}}" type="text" autocomplete="off" autocorrect="off" placeholder="备注"  /></li>
                    </ul>

                    <ul class="form_ul">
                        <li class="form_li" style="width: 235px;">采购计划单号：<input disabled class="form_inp" value="{{$plan_info->plan_num}}" type="text"  /></li>
                    </ul>
                </div>
                <div class="form-group" style="height:30px;">
                    <a class="btn btn-primary addIns " href="javascript:;" style="margin-right:10px;">添加</a>
                </div>
                <div class="form-group oneTb">
                    <div class="fabric_div1">
                        <table class="tab1">
                            <thead>
                                <tr>
                                    <td>厂家货号</td>
                                    <td style="width:80px;background:#f5f5f5;">厂家规格</td>
                                    <td style="width:80px;">颜色</td>
                                    <td style="width:80px;background:#f5f5f5;">颜色说明</td>
                                    <td style="width:80px;">投产需求量</td>
                                    <td style="width:75px;">物控量</td>
                                    <td style="width:75px;">采购量</td>
                                    <td style="width:75px;background:#f5f5f5;">单位</td>
                                    <td style="width:75px;">采购价</td>
                                    <td style="width:75px;">金额</td>
                                    <td style="width:75px;">门幅</td>
                                    <td style="background:#f5f5f5;">成分</td>
                                    <td style="width:45px;">操作</td>
                                </tr>
                            </thead>
                            <tbody>
                            @if(count($fabric_infos))
                                @foreach($fabric_infos as $k => $v)
                                <tr>
                                    <td><input class="form_inp fabric_num rek{{$v['index']}}" type="text" value="{{$v['fabric_num']}}" abc="{{$v['cloth_id']}}"></td>
                                    <td><input disabled class="form_inp guiGe" type="text" value="{{$v['specification']}}"></td>
                                    <td>
                                        <select class="sel_inp color_id">
                                            <option value="">请选择</option>
                                            @foreach($v['color_arr'] as $kk => $vv)
                                                <option value="{{$vv['id']}}" @if($v['color']==$vv['color_name']) selected @endif >{{$vv['color_name']}}</option>
                                            @endforeach
                                        </select>
                                    </td>
                                    <td>
                                        <select disabled class="sel_inp shuoMing">
                                            <option value=""></option>
                                            @foreach($v['color_remark_arr'] as $kk )
                                                <option value="{{$kk}}" @if($kk==$v['color_remark']) selected @endif>{{$kk}}</option>
                                            @endforeach
                                        </select>
                                    </td>
                                    <td><input class="form_inp feis invest_need" type="text" value="{{$v['invest_need']}}"></td>
                                    <td><input class="form_inp feis material_control" type="text" value="{{$v['material_control']}}"></td>
                                    <td><input class="form_inp feis purchase_need" type="text" value="{{$v['purchase_need']}}"></td>
                                    <td><input disabled class="form_inp unit" type="text" value="{{$v['unit']}}"></td></td>
                                    <td><input class="form_inp feis cost" type="text" value="{{$v['cost']}}"></td>
                                    <td><input class="form_inp money" type="text" value="{{$v['cost']*$v['purchase_need']}}"></td>
                                    <td><input class="form_inp door" type="text" value="{{$v['door']}}"></td>
                                    <td><input disabled class="form_inp fabric_ingredient" type="text" value="{{$v['fabric_ingredient']}}"></td>
                                    <td><a href="javascript:;" class="delOpe" @if(!empty($v['id'])) abc="{{$v['id']}}" @else @endif>删除</a></td>
                                </tr>
                                @endforeach
                            @endif
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="form-group"><button type='button' class='save_add btn btn-success' abc="{{$plan_info->id}}">保存</button></div>
            </div>
        </div>
    </div>
    {{--弹框--}}
    <div class="info_box">
        <h3 style="text-align:center;position:relative;margin-bottom:20px;"><span class="infoAdd"></span><i class="fa fa-close chaL"></i></h3>
        <div class="form-group">
            <ul class="form_ul">
                <li class="form_li" style="width:auto;">关键词：<input class="form_inp keywos" type="text" autocomplete="off" autocorrect="off" placeholder="请输入关键词" /></li>
                <button type='button' class='btn btn-info souGo'>搜索</button>
            </ul>
        </div>
        <div class="form-group">
            <table class="gong">
                <thead><tr><td style="width:350px;">供应商</td><td>供应商货号</td></tr></thead>
                <tbody></tbody>
            </table>
        </div>
        <div class="form-group">
            <div class="page1" style="width:430px;float:right;"></div>
        </div>
    </div>
    <div class="mask" style="display:none;"></div>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/planUp.js?v=1.0.3"></script>
@endsection
